﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Workflows.Components.Reports.OpenXmlUtil
{
	/// <summary>
	/// source data can be singular or data table (one table)
	/// </summary>
	[Serializable]
	public class WorksheetDataBinding
	{
		private ExcelDataFillAction _BindingType;
		/// <summary></summary>
		public ExcelDataFillAction BindingType
		{
			get
			{
				return this._BindingType;
			}
			set
			{
				this._BindingType = value;
			}
		}

		private string _WorksheetName;
		/// <summary></summary>
		public string WorksheetName
		{
			get
			{
				return this._WorksheetName;
			}
			set
			{
				this._WorksheetName = value;
			}
		}

		private string _RangeName;
		/// <summary>
		/// either update (single cell $A$1 or range $A$1:$A$21) or fill action (top left cell)
		/// </summary>
		public string RangeName
		{
			get
			{
				return this._RangeName;
			}
			set
			{
				this._RangeName = value;
			}
		}

		private string _ConnStr;
		/// <summary></summary>
		public string ConnStr
		{
			get
			{
				return this._ConnStr;
			}
			set
			{
				this._ConnStr = value;
			}
		}

		private string _SelectSql;
		/// <summary></summary>
		public string SelectSql
		{
			get
			{
				return this._SelectSql;
			}
			set
			{
				this._SelectSql = value;
			}
		}

		private Dictionary<string, string> _Parameters;
		/// <summary></summary>
		public Dictionary<string, string> Parameters
		{
			get
			{
				return this._Parameters;
			}
			set
			{
				this._Parameters = value;
			}
		}

		private bool _IsStoredProc;
		/// <summary></summary>
		public bool IsStoredProc
		{
			get
			{
				return this._IsStoredProc;
			}
			set
			{
				this._IsStoredProc = value;
			}
		}

		private Dictionary<string,int> _ColumnPositions;
		/// <summary></summary>
		public Dictionary<string,int> ColumnPositions
		{
			get
			{
				return this._ColumnPositions;
			}
			set
			{
				this._ColumnPositions = value;
			}
		}

		private int _KeyFieldPos;
		/// <summary>column index in worksheet for key field, such as 1 (default to A)</summary>
		public int KeyFieldPos
		{
			get
			{
				return this._KeyFieldPos;
			}
			set
			{
				this._KeyFieldPos = value;
			}
		}

		private int _ColumnHeaderPos;
		/// <summary>row number that contains column header (default to 1)</summary>
		public int ColumnHeaderPos
		{
			get
			{
				return this._ColumnHeaderPos;
			}
			set
			{
				this._ColumnHeaderPos = value;
			}
		}
	}
}
